<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../common/header.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"></c:set>
<!-- 考勤查询页面开始 -->
<script type="text/javascript"
	src="${pageContext.request.contextPath}/statics/js/jquery.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#hide").click(function() {
			$("#p1").hide();
		});
		$("#show").click(function() {
			$("#p1").show();
		});
	});
	
	  function confirmAct(){
		  if(confirm('确定要执行删除操作吗?')){
			  return true;
		  }
		  return false;
	  }
</script>
<style>
.p {
	background-color: #C5E2D0;
	height: 200px;
	display: none;
	border-radius: 10px;
}
</style>
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="x_panel">
			<h2>今日考勤情况查询</h2>
			<div class="x_content">
				<br />
				<form id="query" data-parsley-validate
					class="form-horizontal form-label-left" method="post"
					action="attendanceservlet">
					<input type="hidden" name="pageIndex" value="1" />
					<ul style="list-style: none; display: inline_block;">
						<li><label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="first-name">培训专业： </label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<select name="major" value="" id="major"
									class="form-control col-md-7 col-xs-12">
									<option value="">---请选择---</option>
									<c:forEach var="maj" items="${majors }">
										<option value="${maj.major}" ${major==maj.major?'selected':''}>${maj.major}</option>
									</c:forEach>
								</select>
							</div></li>
						<li>
							<div class="form-group">
								<label class="control-label col-md-3 col-sm-3 col-xs-12"
									for="first-name">班级： </label>
								<div class="col-md-6 col-sm-6 col-xs-12">
									<select name="classname" id="classname" value=""
										class="form-control col-md-7 col-xs-12">
										<option value="">---请选择---</option>
										<c:forEach var="clist" items="${cList }">
											<option value="${clist.classname}"
												${classname==clist.classname?'selected':''}>${clist.classname}</option>
										</c:forEach>
									</select>
								</div>
							</div>
						</li>
						<li>
							<div class="form-group">
								<label class="control-label col-md-3 col-sm-3 col-xs-12">姓名：
								</label>
								<div class="col-md-6 col-sm-6 col-xs-12">
									<input type="text" name="namec" value="${Name==null?'':Name}"
										class="form-control col-md-7 col-xs-12">
								</div>
							</div>
						</li>
						<li>
							<div class="form-group">
								<label class="control-label col-md-3 col-sm-3 col-xs-12"
									for="first-name">日期: </label>
								<div class="col-md-6 col-sm-6 col-xs-12">
									<input type="date" name="date" value="${date==null?'':date }"
										id="querySoftWareName" class="form-control col-md-7 col-xs-12">
								</div>
							</div>
						</li>
						<li>
							<div class="form-group">
								<label class="control-label col-md-3 col-sm-3 col-xs-12"
									for="first-name">考勤状态： </label>
								<div class="col-md-6 col-sm-6 col-xs-12">
									<select name="result" id="result" value=""
										class="form-control col-md-7 col-xs-12">
										<option value="">---请选择---</option>
										<c:forEach var="clist" items="${workResults }">
											<option value="${clist.ckstatu}"
												${result==clist.ckstatu?'selected':''}>${clist.ckstatu}</option>
										</c:forEach>
									</select>
								</div>

							</div>
						</li>
						<li>
							<div class="form-group">
								<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
									<button type="submit" class="btn btn-primary"
										class="btn btn-success">查&nbsp;&nbsp;&nbsp;&nbsp;询</button>
									<a href="${ctx}/excelattservlet" class="btn btn-primary"
										class="btn btn-success">导&nbsp;&nbsp;&nbsp;&nbsp;出</a>
								</div>
							</div>
						</li>
					</ul>
				</form>
			</div>
		</div>
		<!-- 第二个面板开始 -->
		<div id="p1" class="p" class="x_panel" id="exportPanel">

			<button id="hide" class="btn btn-success btn-sm"
				style="margin-left: 1100px; margin-top: 20px;">关闭</button>

			<div class="x_content">
				<br />
				<form id="demo-form2" data-parsley-validate
					class="form-horizontal form-label-left" method="post"
					action="${ctx }/excelattservlet2">
					<ul style="list-style: none; display: inline_block;">
						<li><label class="control-label col-md-3 col-sm-3 col-xs-12"
							for="first-name">培训专业： </label>
							<div class="col-md-6 col-sm-6 col-xs-12">
								<select name="Emajor" value="" id="Emajor"
									class="form-control col-md-7 col-xs-12">
									<option value="">---请选择---</option>
									<c:forEach var="maj" items="${majors }">
										<option value="${maj.major}" ${Emajor==maj.major?'selected':''}>${maj.major}</option>
									</c:forEach>
								</select>
							</div></li>
						<li>
							<div class="form-group">
								<label class="control-label col-md-3 col-sm-3 col-xs-12"
									for="first-name">班级： </label>
								<div class="col-md-6 col-sm-6 col-xs-12">
									<select name="Eclassname"  value="" id="Eclassname"
										class="form-control col-md-7 col-xs-12">
										<option value="">---请选择---</option>
										<c:forEach var="clist" items="${cList }">
											<option value="${clist.classname}"
												${Eclassname==clist.classname?'selected':''}>${clist.classname}</option>
										</c:forEach>
									</select>
								</div>
							</div>
						</li>
						<li>
							<div class="form-group">
								<label class="control-label col-md-3 col-sm-3 col-xs-12"
									for="first-name">考勤月份: </label>
								<div class="col-md-6 col-sm-6 col-xs-12">
									<input type="month" name="month" value="${month==null?'':month}"
										id="querySoftWareName" class="form-control col-md-7 col-xs-12">
								</div>
							</div>
						</li>
						<li>
							<div class="form-group">
								<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
									<button type="submit" class="btn btn-primary"
										class="btn btn-success">导&nbsp;&nbsp;&nbsp;&nbsp;出</button>
								</div>
							</div>
						</li>
					</ul>
				</form>
			</div>
		</div>
		<!-- 第二个面板结束 -->
		<!-- 表格 -->
		<c:if test="${! empty reportAtts}">
		<div class="col-md-12 col-sm-12 col-xs-12">
			<div class="x_panel">
				<button id="show" class="btn btn-success btn-sm">按月份导出班级学生作业完成情况信息</button>
				<table id="datatable" class="table table-striped table-bordered">
					<thead>
						<tr>
							<th>ID</th>
							<th>学生姓名</th>
							<th>考勤日期</th>
							<th>考勤状态</th>
							<th style="width: 125px;">操作</th>
						</tr>
					</thead>
					<c:forEach var="stu" items="${ reportAtts }">
					<tbody>
						<tr>
							<td>${stu.id }</td>
							<td>${stu.studentName }</td>
							<td>${stu.cktime }</td>
							<td>${stu.ckstatu }</td>
							<td>
								<div class="btn-group">
									<button type="button" class="btn btn-danger">点击操作</button>
									<button type="button" class="btn btn-danger dropdown-toggle"
										data-toggle="dropdown" aria-expanded="false">
										<span class="caret"></span> <span class="sr-only">Toggle
											Dropdown</span>
									</button>
									<ul class="dropdown-menu" role="menu">
										<li><a
											href="report/reportattedit.jsp?id=${ stu.id }&ckstatu=${ stu.ckstatu }
											&studentName=${stu.studentName}&cktime=${stu.cktime}"
											data-toggle="tooltip" data-placement="top"
											data-original-title="修改学生信息">修改</a></li>
										<li><a href="${ctx}/attdelservlet?id=${ stu.id }"
											data-toggle="tooltip" data-placement="top"
											data-original-title="删除学生信息" onclick="return confirmAct();">删除</a></li>
									</ul>
								</div>
							</td>
						</tr>
					</tbody>
					</c:forEach>
					<tr>
						<td colspan="10" style="text-align: right;"><span>共有${pageInfo.totalCount }条数据，${pageInfo.currentPageNo }/${pageInfo.totalPageCount }页</span>
							<a
							href="attendanceservlet?namec=${Name==null?'':Name}&classname=${classname==null?'':classname}&major=${major==null?'':major}&date=${date==null?'':date }&result=${result==null?'':result }&pageIndex=1">首页</a>&nbsp;
							<a
							href="attendanceservlet?namec=${Name==null?'':Name}&classname=${classname==null?'':classname}&major=${major==null?'':major}&date=${date==null?'':date }&result=${result==null?'':result }&pageIndex=${pageInfo.currentPageNo-1}">上一页</a>&nbsp;
							<a
							href="attendanceservlet?namec=${Name==null?'':Name}&classname=${classname==null?'':classname}&major=${major==null?'':major}&date=${date==null?'':date }&result=${result==null?'':result }&pageIndex=${pageInfo.currentPageNo+1}">下一页</a>&nbsp;
							<a
							href="attendanceservlet?namec=${Name==null?'':Name}&classname=${classname==null?'':classname}&major=${major==null?'':major}&date=${date==null?'':date }&result=${result==null?'':result }&pageIndex=${pageInfo.totalPageCount}">末页</a>
						</td>
					</tr>
				</table>
			</div>
		</div>
		</c:if>

	<c:if test="${ empty reportAtts }">
		<h1>没有学生信息</h1>
	</c:if>
		<!-- 表格 -->
		<!-- 分页 -->
		<!-- 分页 -->
	</div>

	<!-- appInfoList页面结束 -->
	<!-- /page content -->
	<%@ include file="../common/footer.jsp"%>
	<script src="${ctx }/statics/localjs/appinfoList.js"></script>
	<script src="${ctx }/statics/localjs/report.js"></script>

	<script
		src="${pageContext.request.contextPath }/statics/localjs/exportMoringResult.js"></script>